//
//  WMSplashAd.h
//  WonderMobSDK
//
//  Created by zero on 2020/3/2.
//

#import <UIKit/UIKit.h>

@class WMSplashAd, WMAdId;

NS_ASSUME_NONNULL_BEGIN

@protocol WMSplashAdDelegate <NSObject>

@optional

/// 广告数据加载成功回调
/// @param splashAd WMSplashAd 实例
- (void)wm_splashAdDidLoadSuccess:(WMSplashAd *)splashAd;

/// 广告各种错误信息回调
/// @param splashAd WMSplashAd 实例
/// @param error 具体错误信息
- (void)wm_splashAd:(WMSplashAd *)splashAd didFailWithError:(NSError * _Nullable)error;

/// 广告被点击
/// @param splashAd WMSplashAd 实例
- (void)wm_splashAdDidClick:(WMSplashAd *)splashAd;

/// 广告被关闭
/// @param splashAd WMSplashAd 实例
- (void)wm_splashAdDidClose:(WMSplashAd *)splashAd;

@end

@interface WMSplashAd : NSObject

/// 构造方法
/// @param adIdModel 后台方案 id
/// @param viewController 用于展示广告的 controller
- (instancetype)initWithAdIdModel:(WMAdId *)adIdModel
                   viewController:(UIViewController *)viewController;

/// 更新本地配置
- (void)getPlatforms;


/// 显示开开屏广告
- (void)showSplashAd;

/// 委托对象
@property (nonatomic, weak) id<WMSplashAdDelegate> delegate;

@property (nonatomic, copy) void(^logBblock)(NSString *log);

@end

NS_ASSUME_NONNULL_END
